$(document).ready(function(){
/*------------------------------------------------------
				A D M I N  T A B S
------------------------------------------------------*/
$('a[href^=#general]').click(function() { $('.tab').attr("value","0") });
$('a[href^=#homepage]').click(function() { $('.tab').attr("value","1") });
$('a[href^=#portfolio]').click(function() { $('.tab').attr("value","2") });
$('a[href^=#misc]').click(function() { $('.tab').attr("value","3") });
$('a[href^=#style]').click(function() { $('.tab').attr("value","4") });
$('a[href^=#ads]').click(function() { $('.tab').attr("value","5") });


/*------------------------------------------------------
				H O M E P A G E
------------------------------------------------------*/
	$('#thumbs_flickr').click(function() { $('#fp_options').show(); $('#featured_box_posts').hide(); $('#featured_box_flickr').show(); });
	$('#thumbs_posts').click(function() { $('#fp_options').show(); $('#featured_box_posts').show(); $('#featured_box_flickr').hide(); });
	$('#thumbs_none').click(function() { $('#fp_options').hide(); });
	check = $('#thumbs_flickr').attr('checked'); if (check == true) { $('#featured_box_flickr').css({'display':'block'}); $('#fp_options').css({'display':'block'});}
	check = $('#thumbs_posts').attr('checked'); if (check == true) { $('#featured_box_posts').css({'display':'block'}); $('#fp_options').css({'display':'block'});}

/*------------------------------------------------------
				P O R T F O L I O
------------------------------------------------------*/
	$('#enable_portfolio').click(function() { $('#portfolio_box').show(); });
	$('#disable_portfolio').click(function() { $('#portfolio_box').hide(); });
	check = $('#enable_portfolio').attr('checked'); if (check == true) { $('#portfolio_box').css({'display':'block'}); }


/*------------------------------------------------------
				M I S C
------------------------------------------------------*/
/*	BREADCRUMBS
*/
	$('#enable_bread').click(function() { $('#breadbox').show(); });
	$('#disable_bread').click(function() { $('#breadbox').hide(); });
	check = $('#enable_bread').attr('checked'); if (check == true) { $('#breadbox').css({'display':'block'}); }


/*	LIFESTREAM
*/
	$('#enable_lifestream').click(function() { $('#lifestreambox').show(); });
	$('#disable_lifestream').click(function() { $('#lifestreambox').hide(); });
	check = $('#enable_lifestream').attr('checked'); if (check == true) { $('#lifestreambox').css({'display':'block'}); }


/*------------------------------------------------------
				C O L O R  P I C K E R S
------------------------------------------------------*/
/*	BACKGROUND
*/
	$("input#background_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#background_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	H1 TITLE
*/
	$("input#h1_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#h1_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	TITLES
*/
	$("input#titles_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#titles_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	LINKS COLOR
*/
	$("input#links_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#links_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	LINKS COLOR:HOVER
*/
	$("input#links_hover_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#links_hover_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	MENU LINKS COLOR
*/
	$("input#menu_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#menu_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	MENU LINKS COLOR:HOVER
*/
	$("input#menu_hover_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#menu_hover_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	MENU LINKS COLOR:SELECTED
*/
	$("input#menu_selected_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#menu_selected_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	MENU BACKGROUND COLOR
*/
	$("input#menu_bg_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#menu_bg_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	MENU BACKGROUND COLOR:HOVER
*/
	$("input#menu_hover_bg_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#menu_hover_bg_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	MENU BACKGROUND COLOR:SELECTED
*/
	$("input#menu_selected_bg_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#menu_selected_bg_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	FOOTER BACKGROUND
*/
	$("input#footer_bg_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#footer_bg_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	FOOTER SIDEBAR BACKGROUND
*/
	$("input#footer_sidebar_bg_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#footer_sidebar_bg_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	FOOTER TITLES
*/
	$("input#footer_titles_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#footer_titles_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	FOOTER TEXT COLOR
*/
	$("input#footer_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#footer_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	FOOTER LINKS COLOR
*/
	$("input#footer_links_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#footer_links_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	FOOTER LINKS:HOVER COLOR
*/
	$("input#footer_links_hover_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('input#footer_links_hover_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

/*	FOOTER BORDERS INSIDE COLOR
*/
	$("input#footer_border_inside_color").ColorPicker({
	onSubmit: function(hsb, hex, rgb, el) {	$(el).val(hex);	$(el).ColorPickerHide(); },
	onBeforeShow: function () {	$(this).ColorPickerSetColor(this.value);},
	onChange: function (hsb, hex, rgb) { $('footer_border_inside_color').attr('value', hex); } })
	.bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); });

	/**************************************/

	
	nanotabs({c:"tab-navigation", e:"click", s:"selected", d:0, f:false});
	
	$('.themestyle-block').click(function(event){
		blockID = this.id;
		$('.themestyle-block').removeClass('active');
		
	
		$('#'+blockID).addClass('active');
		$("#themestyle_"+blockID).attr("checked", "checked"); 
	});

		
});